package main

import "fmt"

// 利用结构体参数或... 传入参数切片数组
func sum(nums ...int) {
	total := 0
	for _, num := range nums {
		total += num
	}
	fmt.Println(total)
}

func main() {
	sum(1, 3, 4)
	sum(2, 4, 6)
}
